<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>个人信息</title>
<link rel="stylesheet" href="{{ asset('admin_style/css/pintuer.css') }}">
   <link rel="stylesheet" href="{{ asset('admin_style/css/admin.css') }}">
    <script src="{{asset('admin_style/js/jquery.js')}}"></script>
    <script src="{{asset('admin_style/js/pintuer.js')}}"></script>
<link rel="stylesheet" href="{{asset('admin_style/css/style.css')}}">
<!--<link rel="stylesheet" href="css/ace.min.css">-->
<script src="{{asset('admin_style/js/layer/layer.js')}}"></script>

</head>
<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 个人信息</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
        <div class="clearfix">
 <div class="admin_info_style">
   <div class="admin_modify_style" id="Personal">
     <div class="type_title">管理员信息 </div>
      <div class="xinxi">
      <form action="{{ url('admin/ge_up')}}" method="post">
          <div class=" form-group container"><label class="xs1 text-right " for="form-field-1">用户名： </label>
          <div class="xs11"><input type="text" name="u_name" id="website-title" value="{{$data->u_name}}" class="xs2 text_info" disabled="disabled">
          &nbsp;&nbsp;&nbsp;<a href="javascript:ovid()" onclick="change_Password()" class="button button-small bg-red ">修改密码</a></div>
          
          </div>
          <div class="form-group container"><label class="xs1 text-right" for="form-field-1">性别： </label>
          <div class="xs11">
          <span class="sex">{{$data->u_sex}}</span>
            <div class="add_sex">
            <label><input name="u_sex" type="radio" class="ace" checked="checked" value="保密"><span class="lbl">保密</span></label>&nbsp;&nbsp;
            <label><input name="u_sex" type="radio" class="ace" value="男"><span class="lbl">男</span></label>&nbsp;&nbsp;
            <label><input name="u_sex" type="radio" class="ace" value="女"><span class="lbl">女</span></label>
            </div>
           </div>
          </div>
          <div class="form-group container"><label class="xs1 text-right" for="form-field-1">移动电话： </label>
          <div class="xs11"><input type="text" name="u_phone" id="website-title" value="{{$data->u_phone}}" class="col-xs-7 text_info" disabled="disabled"></div>
          </div>
          <div class="form-group container"><label class="xs1 text-right" for="form-field-1">电子邮箱： </label>
          <div class="xs11"><input type="text" name="u_email" id="website-title" value="{{$data->u_email}}" class="col-xs-7 text_info" disabled="disabled"></div>
          </div>
           <div class="form-group container"><label class="xs1 text-right" for="form-field-1">注册时间： </label>
          <div class="xs11" > <span>{{date('Y-m-d H:i:s',$data->u_starttime)}}</span></div>
          </div>
           <div class="Button_operation clearfix"> 
           <input type="hidden" name="_token" value="{{csrf_token()}}">
           <input type="hidden" name="id" value="{{$data->id}}">
           <button onclick="modify();" id="cs" class="button bg-yellow margin-right" type="button" >修改信息</button>  
          <div id="id"></div>
        <!-- <button onclick="save_info();" class="button bg-green " type="button">保存修改</button> -->
      </form>
      
      </div>
            </div>
    </div>
  
<!--修改密码样式-->
         <div class="change_Pass_style" id="change_Pass">
           <form action="{{ url('admin/gly_pass')}}" method="post">
             <ul class="xg_style">

               <li><label class="label_name">原&nbsp;&nbsp;密&nbsp;码</label><input name="outpassword" type="password" class="input" id="password" style="width: 150px;"></li>
               <li><label class="label_name">新&nbsp;&nbsp;密&nbsp;码</label><input name="password" type="password" class="input" id="Nes_pas"></li>
               <li><label class="label_name">确认密码</label><input name="onpassword" type="password" class="input" id="c_mew_pas"></li>
              </ul>
              <input type="hidden" name="_token" value="{{csrf_token()}}">
              <div class="center" align="center"> <input type="submit" value="确认修改" ></div>
           </form>
     <!--       <div class="center"> <button class="btn btn-primary" type="button" id="submit">确认修改</button></div>-->
         </div>
<script type="text/javascript">

//按钮点击事件
function modify(){
   $('.text_info').attr("disabled", false);
   $('.text_info').addClass("add");
    $('#Personal').find('.xinxi').addClass("hover");
    $('#Personal').find('.btn-success').css({'display':'block'});
    $('#id').append('<input type="submit" class="button bg-green " value="保存修改">');

  };
  $('#cs').click(function (){
      $(this).attr("disabled","disabled");
  });
function save_info(){
      var num=0;
     var str="";
     $(".xinxi input[type$='text']").each(function(n){
          if($(this).val()=="")
          {
               
         layer.alert(str+=""+$(this).attr("name")+"不能为空！\r\n",{
                title: '提示框',       
        icon:0,               
          }); 
        num++;
            return false;            
          } 
     });
      if(num>0){  return false;}    
          else{
        
         layer.alert('修改成功！',{
               title: '提示框',        
         icon:1,            
        });
        $('#Personal').find('.xinxi').removeClass("hover");
        $('#Personal').find('.text_info').removeClass("add").attr("disabled", true);
        $('#Personal').find('.btn-success').css({'display':'none'});
         layer.close(index);
      
      }         
  };  
 //初始化宽度、高度    
//  $(".admin_modify_style").height($(window).height()); 
  $(".recording_style").width($(window).width()-400); 
    //当文档窗口发生改变时 触发  
    $(window).resize(function(){
//  $(".admin_modify_style").height($(window).height()); 
  $(".recording_style").width($(window).width()-400); 
  });
  //修改密码
  function change_Password(){
     layer.open({
    type: 1,
  title:'修改密码',
  area: ['300px','300px'],
  shadeClose: true,
  content: $('#change_Pass'),
  yes:function(index, layero){    
       if ($("#password").val()==""){
        layer.alert('原密码不能为空!',{
              title: '提示框',       
        icon:0,
          
       });
      return false;
          } 
      if ($("#Nes_pas").val()==""){
        layer.alert('新密码不能为空!',{
              title: '提示框',       
        icon:0,
          
       });
      return false;
          } 
       
      if ($("#c_mew_pas").val()==""){
        layer.alert('确认新密码不能为空!',{
              title: '提示框',       
        icon:0,
          
       });
      return false;
          }
        if(!$("#c_mew_pas").val || $("#c_mew_pas").val() != $("#Nes_pas").val() )
        {
            layer.alert('密码不一致!',{
              title: '提示框',       
        icon:0,
          
       });
       return false;
        }   
     else{        
        layer.alert('修改成功！',{
               title: '提示框',        
      icon:1,   
        }); 
        layer.close(index);      
      }  
  }
    });
    }

</script>
</body>
</html>
